const product = require('../../utils/product.js')
var app = getApp()
Page({
  data: {
    list: [],
    item: [],
    banner: [],
    title: '',
    id: 0,
    product: {},
    windowWidth: 375,
    windowHeight: 600,
    pixelRatio: 2,  
    accountType: ''
  },

  bindList: function (e) {
    wx.navigateTo({
      url: `../list/list?cat_title=${e.currentTarget.dataset.title}`
    })
  },
  onLoad: function (params) {
    var that = this
    product.getdetail(params.id, function (resolve) {
      var data = resolve.data;
      that.setData({ 'detail': data })
      wx.setStorage({
        key: "detail",
        data: data
      })
    })
    product.getbanner(params.id, function (resolve) {
      var data = resolve.data;
      that.setData({ 'banner': data })
      wx.setStorage({
        key: "banner",
        data: data
      })
    })
  },
})
